<?php

function qqjd($qqnum,$quota){
$qqjd=($qqnum/$quota)*100;
return $qqjd;
}


function qiandaopd($commontime){
$time=time();
$date=$commontime;
$time1=date("Y-m-d",$time);
$date1=date("Y-m-d",$date);
if ($time1==$date1){
$qiandaopd=print <<<EOT
<span class="YesQianDao">今日已经签到</span>
EOT;
}else{
$qiandaopd=print <<<EOT
<a href="../do.php?type=qiandao">每日签到</a>
EOT;
}
return $qiandaopd;
}


function qqol($qqolzt){
if ($qqolzt==0){
$qqol='<span class="sidolcolorgreen">安全在线</span>';
}else{
$qqol='<span class="sidolcolorred">已经下线</span>';
}
return $qqol;
}

function wherefuwu($fwq){
$fw['server1']="①号服";
$fw['server2']="②号服";
$fw['server3']="③号服";
$fuwu=$fw["$fwq"];
return $fuwu;
}


function sidol($sidzt){
if($sidzt==1){
$sidol='<span class="sidolcolorred">出现验证码,推荐删除重挂</span>';
}else{
$sidol='<span class="sidolcolorgreen">挂机安全运行中</span>';
}
return $sidol;
}


function warnstyle($warn){
if($warn==0){
$warnol='<span class="sidolcolorgreen">'.$warn.'</span>';
}else{
$warnol='<span class="sidolcolorred">'.$warn.'</span>';
}
return $warnol;
}


function hooktime($adddate){
$times=round((time()-$adddate)/60,0);
return $times;
}



function batchpage(){
print <<<EOT
<div id="user-content-right-main-qqlist-button-batch">
	<a onclick="batchaddqq();">批量添加QQ</a>
</div>
EOT;
}

function qqlistpage($cookieuser){
$mysql_qqlist = mysql_query("SELECT * FROM  `xige_qqlist` WHERE  `email` =  '$cookieuser' ORDER BY  `id` ASC ");
$qqnum=0;
while($qqlistqq = mysql_fetch_array($mysql_qqlist)){
$qqnum++;
qqlist($qqlistqq['qid'],$qqnum,$qqlistqq['qq'],qqol($qqlistqq['qqol']),date("Y-m-d H:i:s",$qqlistqq['adddate']),wherefuwu($qqlistqq['fwq']),$qqlistqq['sid'],sidol($qqlistqq['sidol']),hooktime($qqlistqq['adddate']),warnstyle($qqlistqq['warn']),$qqlistqq['warn']);
}
}


function qqlist($qid,$qqnum,$qq,$qqol,$adddate,$fuwu,$sid,$sidol,$hooktime,$warnstyle,$warn){


if ($warn!=0){
$qqliststyle="qqlist-div-headerred";
$qqlistcur="qqlistcurred";
}else{
$qqlistcur="qqlistcur";
if ($qqnum%2==0){
$qqliststyle="qqlist-div-header1";
}else{
$qqliststyle="qqlist-div-header2";
}
}
print <<<EOT
<!-- 开始 -->
<div class="$qqliststyle  $qqlistcur">
	<div class="qqlist-checkbox">
		<input type="checkbox" name="qid[]" value="$qid"">
	</div>
	<div class="qqlist-num">
		$qqnum
	</div>
	<div class="qqlist-qqnumber">
		<div class="qqlist-qqnumber-a">
			<div class="qqlist-qqnumber-avatar">
			<img src="http://q2.qlogo.cn/headimg_dl?bs=qq&dst_uin=$qq&spec=100">
			</div>
			<div class="qqlist-qqnumber-info">
				<div class="qqlist-qqnumber-qq">
					$qq
				</div>
				<div class="qqlist-qqnumber-addtime">
					$adddate
				</div>
			</div>
		</div>
	</div>
	<div class="qqlist-server">
		$fuwu
	</div>
	<div class="qqlist-qqstatus">
		<div class="qqlist-qqstatus-height">
			<div class="qqlist-qqstatus-1">
				<div class="qqlist-qqstatus-1-a">
					QQ状态:
				</div>
				<div class="qqlist-qqstatus-1-b">
					<a href="http://wp.qq.com" target="_blank">
						<img src="http://wpa.qq.com/pa?p=2:$qq:2" title="这是您QQ状态,如果未启用请去官网开启">
					</a>
				</div>
			</div>
			<div class="qqlist-qqstatus-2">
				<div class="qqlist-qqstatus-2-a">
					系统状态:
				</div>
				<div class="qqlist-qqstatus-2-b">
					$qqol
				</div>
			</div>
		</div>
	</div>
	<div class="qqlist-sidstatus">
		<div class="qqlist-sidstatus-sid">
			SID:$sid
		</div>
		<div class="qqlist-sidstatus-status">
			SID状态:$sidol
		</div>
	</div>
	<div class="qqlist-time" title="删除QQ后计算入挂Q时长中">
		$hooktime 分钟
	</div>
	<div class="qqlist-warn">
	$warnstyle 次
	</div>
</div>
<!-- 结束 -->
EOT;
}

function qqlistsearch($qq,$cookieuser){
$mysql_search = mysql_query("SELECT * FROM xige_qqlist WHERE email='$cookieuser' and qq='$qq'");
$qqlistqq=mysql_fetch_array($mysql_search);
if ($qq==$qqlistqq['qq']){
qqlist($qqlistqq['qid'],"1",$qqlistqq['qq'],qqol($qqlistqq['qqol']),date("Y-m-d H:i:s",$qqlistqq['adddate']),wherefuwu($qqlistqq['fwq']),$qqlistqq['sid'],sidol($qqlistqq['sidol']),hooktime($qqlistqq['adddate']));
}else{
echo '<div id="qqsearchno">您所查询的QQ不存在</div>';
}
}


?>